cmake_minimum_required(VERSION 2.8)

add_definitions("-g")
add_definitions("-W")
add_definitions("-O3")
add_definitions("-Wall")
add_definitions("-Werror")
add_definitions("-Wshadow")
add_definitions("-Wformat")
add_definitions("-Wpointer-arith")
add_definitions("-D_REENTRANT")
add_definitions("-D_USE_FAST_MACRO")
add_definitions("-Wno-long-long")
add_definitions("-Wuninitialized")
add_definitions("-D_POSIX_PTHREAD_SEMANTICS")
add_definitions("-DHAS_MYSQL_DLL")
add_definitions("-DHAS_SQLITE_DLL")

if (CMAKE_SYSTEM_NAME MATCHES "Linux")
	add_definitions("-DLINUX2")
	add_definitions("-fPIC")
endif()

set(rpath lib_acl_cpp)
set(src ${PROJECT_SOURCE_DIR}/${rpath}/src)
set(acl_path ${PROJECT_SOURCE_DIR}/lib_acl)
set(acl_include ${acl_path}/include)
set(proto_path ${PROJECT_SOURCE_DIR}/lib_protocol)
set(proto_include ${proto_path}/include)
set(mysql_include ${PROJECT_SOURCE_DIR}/include/mysql)
set(sqlite_include ${PROJECT_SOURCE_DIR}/include/sqlite)

include_directories(${mysql_include})
include_directories(${sqlite_include})
include_directories(${acl_include})
include_directories(${proto_include})
include_directories(${PROJECT_SOURCE_DIR}/${rpath}/src)
include_directories(${PROJECT_SOURCE_DIR}/${rpath}/include)

aux_source_directory(${src} lib_src)
aux_source_directory(${src}/aliyun lib_src)
aux_source_directory(${src}/beanstalk lib_src)
aux_source_directory(${src}/connpool lib_src)
aux_source_directory(${src}/db lib_src)
aux_source_directory(${src}/disque lib_src)
aux_source_directory(${src}/event lib_src)
aux_source_directory(${src}/hsocket lib_src)
aux_source_directory(${src}/http lib_src)
aux_source_directory(${src}/ipc lib_src)
aux_source_directory(${src}/master lib_src)
aux_source_directory(${src}/memcache lib_src)
aux_source_directory(${src}/mime lib_src)
aux_source_directory(${src}/mime/internal lib_src)
aux_source_directory(${src}/queue lib_src)
aux_source_directory(${src}/redis lib_src)
aux_source_directory(${src}/serialize lib_src)
aux_source_directory(${src}/session lib_src)
aux_source_directory(${src}/smtp lib_src)
aux_source_directory(${src}/stdlib lib_src)
aux_source_directory(${src}/stream lib_src)

add_library(_acl_cpp ${lib_src})
